package org.lex.reflect.browsing.view;

import javax.swing.JFrame;

import org.lex.app.Application;
import org.lex.swing.Swings;


public class ClassBrowser extends Application {
	public String getApplicationID() {
		return "classbrowser";
	}

	private JFrame mainframe = null;

	public JFrame getRootWindow() {
		if (null == mainframe) {
			mainframe = new JFrame();
			mainframe.setName(this.getClass().getName() + ".mainframe");
			mainframe.setContentPane(new ClassBrowserPane());
			mainframe.setTitle("Class Browser");
			mainframe.setSize(800, 600);
		}
		return mainframe;
	}

	protected void initialize(String[] args) {
		this.getContext().getSessionStorage().restore(this.getRootWindow());
		this.mainframe.setVisible(true);
	}

	protected void shutdown() {
		this.getContext().getSessionStorage().save(this.getRootWindow());
	}

	public static void main(String[] args) {
		String cp = System.getProperty("java.class.path");
		if (null != cp) {
			System.out.println("cp: " + cp);
			// cp = cp + ";E:\\Projects\\Jar\\P2PClient.jar";
			// System.setProperty( "java.class.path", cp );
		}
		Swings.setUseBoldMetalFont(false);
		Application.launch(ClassBrowser.class, args);
	}
}
